#!/bin/bash
# 允许上报 calicoctl patch felixconfiguration default  --patch '{"spec":{"prometheusMetricsEnabled": true}}'
# 检查calico 网络状态可以通过ping tunl0     ip addr|grep tun -A 2

DATE="`date +"%Y-%m-%d %H:%M:%S"`"
ipaddr=(192.168.1.64 192.168.105.64 192.168.1.99 192.168.1.0 192.168.5.12 192.168.5.148 192.168.5.71 192.168.1.74 192.168.5.146 192.168.1.173 192.168.2.185 192.168.5.65 192.168.5.197 192.168.5.130 192.168.202.128 192.168.5.133 192.168.140.0 192.168.5.210 192.168.5.15 192.168.5.73 192.168.5.149 192.168.3.23 192.168.5.222 192.168.5.88 192.168.4.129 192.168.5.76 192.168.5.209 192.168.5.211 192.168.5.212 192.168.5.25 192.168.5.86 192.168.5.81 192.168.5.26 192.168.5.21 192.168.5.129 192.168.5.75 192.168.173.64 192.168.5.6 192.168.5.67 192.168.5.5 192.168.5.145 192.168.5.150 192.168.5.17 192.168.5.202 192.168.5.3 192.168.5.66 192.168.5.135 192.168.251.0 192.168.5.9 192.168.5.0 192.168.5.79 192.168.5.69 192.168.5.31 192.168.0.160 192.168.5.68 192.168.5.195 192.168.193.128 192.168.147.64 192.168.243.66 192.168.171.64 192.168.142.168 192.168.229.0 192.168.172.192 192.168.219.64 192.168.251.128 192.168.200.0 192.168.191.64 192.168.213.128)

for i in ${ipaddr[*]}
do
if ping -c 1 -W 1 ${i} > /dev/null 2>&1
then
    echo "$DATE ping ${i} is successful!"
else
    echo "$DATE ping ${i} is failure!"
fi
done



